<?php

namespace apiend\modules\v1\controllers;

use Yii;
use apiend\components\Controller;

class HomeController extends Controller {

    public function actionIndex() {

        $style = Yii::$app->request->get('style');
        $navi = [];
        if (is_null($style)) {
            $navi = [
                'style' => 1,
                'config' => [
                    'home' => '贵州恒丰',
                    'homg_icon' => 'http://192.168.0.105/lntsapp/apps/api/web/uploads/attachments/default/navi-icon/2.png',
                    'away' => '山东鲁能泰山',
                    'away_icon' => 'http://192.168.0.105/lntsapp/apps/api/web/uploads/attachments/default/navi-icon/1.png',
                    'time' => '2018.3.4 周日',
                    'weather' => '晴',
                    'weather_data' => '24°C',
                    'weather_icon' => 'http://192.168.0.105/lntsapp/apps/api/web/uploads/attachments/default/navi-icon/3.png',
                    'background_img' => 'http://192.168.0.105/lntsapp/apps/api/web/uploads/attachments/default/navi-icon/4.png',
                ],
            ];
        } else if ($style == 2) {
            $navi = [
                'style' => 2,
                'config' => [
                    'background_img' => 'http://192.168.0.105/lntsapp/apps/api/web/uploads/attachments/default/navi-icon/5.png',
                ],
            ];
        } else if ($style == 3) {
            $navi = [
                'style' => 2,
                'config' => [
                    'background_img' => 'http://192.168.0.105/lntsapp/apps/api/web/uploads/attachments/default/navi-icon/6.png',
                ],
            ];
        }

        return [
            'navi' => $navi,
            // 1发布动态 2发布视频 3新增webview页面
            'categories' => [
                [
                    'title' => '推荐',
                    'cateid' => 2,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/2"
                ],
                [
                    'title' => '官方',
                    'cateid' => 3,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/3"
                ],
                [
                    'title' => '综合',
                    'cateid' => 15,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/15"
                ],
                [
                    'title' => '球队',
                    'cateid' => 26,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/26"
                ],
                [
                    'title' => '媒体',
                    'cateid' => 9,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/9"
                ],
                [
                    'title' => '鲁蜜',
                    'cateid' => 25,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/25"
                ],
                [
                    'title' => '青训',
                    'cateid' => 5,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/5"
                ],
                [
                    'title' => '乒乓球',
                    'cateid' => 6,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/6"
                ],
                [
                    'title' => '图片',
                    'cateid' => 13,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/13"
                ],
                [
                    'title' => '视频',
                    'cateid' => 14,
                    'redirect' => "https://daas.lnts.cn/m/headline/channel/show/14"
                ],
            ],
            'tabbar' => [
                '说明' => '底部tabbar模块。 1发布动态 2发布视频 3新增webview页面, ad增加的广告条',
                'common' => [
                    [
                        'mode' => 1,
                        'title' => '发布动态',
                        'icon' => 'http://xxxx.jpeg',
                    ],
                    [
                        'mode' => 2,
                        'title' => '发布视频',
                        'icon' => 'http://xxxx.jpeg',
                    ],
                    [
                        'mode' => 3,
                        'title' => '新增活动',
                        'url' => 'http://xxxxxx.com',
                        'icon' => 'http://xxxx.jpeg',
                    ],
                ],
                'ad' => [
                    'img' => 'http://xxx.jpeg',
                    'link' => 'http://www.xxx.com',
                ],
            ],
        ];
    }

}
